/* 语音测试页面样式 */
.voice-test-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: 'Arial', sans-serif;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

/* 状态指示器 */
.status-section {
    text-align: center;
    margin-bottom: 30px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 15px 25px;
    border-radius: 25px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.status-indicator.recording {
    background: #fff5f5;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.status-indicator.processing {
    background: #fffbf0;
    border-color: #ffc107;
    color: #ffc107;
}

.status-indicator.idle {
    background: #f0f9ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.status-indicator.recording .status-dot {
    background: #ff6b6b;
    animation: pulse 1s infinite;
}

.status-indicator.processing .status-dot {
    background: #ffc107;
    animation: pulse 0.5s infinite;
}

.status-indicator.idle .status-dot {
    background: #3b82f6;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.status-text {
    font-weight: 600;
    font-size: 16px;
}

.service-indicator {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 控制按钮 */
.control-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.start-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

.start-btn.active {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    animation: recordingPulse 1s infinite;
}

@keyframes recordingPulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 107, 0.8);
    }

    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }
}

.stop-btn {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

.clear-btn {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.clear-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.6);
}

.debug-btn {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.debug-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.6);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 服务切换按钮 */
.service-switch-section {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.service-btn {
    padding: 8px 20px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.service-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.service-btn:hover:not(:disabled) {
    background: #0056b3;
    color: white;
    border-color: #0056b3;
    transform: translateY(-1px);
}

/* 错误显示 */
.error-section {
    margin-bottom: 30px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.error-icon {
    font-size: 1.2rem;
}

.error-text {
    flex: 1;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    color: #721c24;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.error-close:hover {
    background-color: rgba(114, 28, 36, 0.1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 当前识别结果 */
.result-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.current-result {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 历史记录 */
.history-section {
    margin-bottom: 30px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.empty-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.history-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-index {
    color: #6c757d;
    font-weight: 600;
    margin-right: 10px;
    min-width: 20px;
}

.history-text {
    color: #333;
    line-height: 1.5;
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 使用说明 */
.instructions-section {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #bbdefb;
}

.instructions-section ul {
    margin: 0;
    padding-left: 20px;
}

.instructions-section li {
    margin-bottom: 8px;
    color: #1565c0;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .voice-test-page {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .control-section {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }

    .history-list {
        max-height: 200px;
    }
}

/* 滚动条样式 */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}